/**
 * Copyright ©2016-2020 northkingbpo Corporation, All Rights Reserved
 * http://www.northkingbpo.net/
 */

import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * class info
 *
 * @author hujia
 * @date 2018/11/9 08:03
 */
public class JedisConfig {

    private String host = "192.168.0.101";
    private int port = 6379;

    public JedisPool redisPoolFactory() {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxIdle(10);
        jedisPoolConfig.setMaxWaitMillis(20000);
        jedisPoolConfig.setMinIdle(2);
        jedisPoolConfig.setMaxTotal(3000);
        int timeout = 20000;
        JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout);
        return jedisPool;
    }
}
